<?php echo $this->renderElement('admin/menu'); ?>
<br />
<?php echo $html->link("Add contract", '/contracts/add')."<br /><br />"; ?>

<h2><?php echo __('list_contracts'); ?></h2>
<div class="largebloc2">
<br />
<table width="100%">
<th>#id</th><th><?php echo __('ref_number'); ?></th><th><?php __('company'); ?></th><th><?php __('dayli_rate'); ?></th><th>Status</th><th>Actions</th>
<?php
	foreach($contracts as $contract):
		echo "<tr>";
		echo "<td>".$html->link("#".$contract['Contract']['id'], '/contracts/view/'.$contract['Contract']['id'])."</td>";
		echo "<td>".$html->link($contract['Contract']['ref'], '/contracts/view/'.$contract['Contract']['id'])."</td>";
		echo "<td>".$cf->getCompanyName($companies, $contract['Contract']['company_id'])."</td>";
		echo "<td>".$contract['Contract']['tjm']."</td>";
		echo "<td>".$contract['Contract']['status']."</td>";
		echo "<td>".$html->link(__('view', true), '/contracts/view/'.$contract['Contract']['id'])." | ".$html->link(__('edit', true), '/contracts/edit/'.$contract['Contract']['id'])." | ".$html->link(__('delete', true), '/contracts/del/'.$contract['Contract']['id'])."</td>";				
		echo "</tr>";
	endforeach;
?>
</table>
</div>